{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "forced-trading",
   "metadata": {},
   "source": [
    "# Multimodel serving with over-commit example\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "5745880c",
   "metadata": {},
   "source": [
    "Note: this notebook requires access to internal services, so either `make start-all-host` (under `scheduler` sub directory) or expose the relevant ports."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b5ebabe7",
   "metadata": {},
   "source": [
    "## `iris` model on `MLServer`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "e52febfc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "env: INFER_ENDPOINT=0.0.0.0:9000\n",
      "env: SCHEDULER_ENDPOINT=0.0.0.0:9004\n",
      "env: MLSERVER_DEBUG=0.0.0.0:7777\n",
      "env: TRITON_DEBUG=0.0.0.0:7778\n"
     ]
    }
   ],
   "source": [
    "%env INFER_ENDPOINT=0.0.0.0:9000\n",
    "%env SCHEDULER_ENDPOINT=0.0.0.0:9004\n",
    "%env MLSERVER_DEBUG=0.0.0.0:7777\n",
    "%env TRITON_DEBUG=0.0.0.0:7778"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ebf5eb28",
   "metadata": {},
   "source": [
    "By default if running locally there is 1 replica of `mlserver` with memory slots up to 10MB and 20% overcommit budget. We will load 11 `iris` models each requiring 1MB worth of memory slots as an example. These numbers allow for 10 models to be active at the same time and 1 model to be evicted to disk.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "unusual-mills",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "loading model iris1\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris2\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris3\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris4\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris5\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris6\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris7\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris8\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris9\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris10\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model iris11\n",
      "{\n",
      "  \n",
      "}\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "for i in {1..11}; \n",
    "do\n",
    "\n",
    "echo \"loading model iris$i\"\n",
    "\n",
    "data='{ \n",
    "        \"model\":{ \n",
    "            \"meta\": {\"name\":\"iris'\"$i\"'\"}, \n",
    "            \"modelSpec\" : { \n",
    "                \"uri\":\"gs://seldon-models/mlserver/iris\", \n",
    "                \"requirements\":[\"sklearn\"],  \n",
    "                \"memoryBytes\":1000000}, \n",
    "            \"deploymentSpec\": {\"replicas\":1}\n",
    "            }\n",
    "      }'\n",
    "\n",
    "grpcurl -d \"$data\" \\\n",
    "-plaintext \\\n",
    "-import-path ../apis \\\n",
    "-proto ../apis/mlops/scheduler/scheduler.proto \"$SCHEDULER_ENDPOINT\" seldon.mlops.scheduler.Scheduler/LoadModel\n",
    "\n",
    "sleep 0.05\n",
    "done"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9faa0e33",
   "metadata": {},
   "source": [
    "Get the list of models on this mlserver replica and whether they are loaded in main memory"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "sunset-theta",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "  \"models\": [\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:45:40Z\",\n",
      "      \"name\": \"iris10_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris3_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris6_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris1_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"iris11_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris9_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris7_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris8_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris5_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris4_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:44:48Z\",\n",
      "      \"name\": \"iris2_1\"\n",
      "    }\n",
      "  ]\n",
      "}\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "grpcurl -d '{}' \\\n",
    "         -plaintext \\\n",
    "         -import-path ../apis/ \\\n",
    "         -proto ../apis/mlops/agent_debug/agent_debug.proto  ${MLSERVER_DEBUG} seldon.mlops.agent_debug.AgentDebugService/ReplicaStatus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "naval-geography",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "All succeeded\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "for i in {1..11}; \n",
    "do\n",
    "\n",
    "url=http://${INFER_ENDPOINT}/v2/models/iris${i}/infer \n",
    "ret=`curl -s -o /dev/null -w \"%{http_code}\" \"${url}\" -H \"Content-Type: application/json\" \\\n",
    "        -d '{\"inputs\": [{\"name\": \"predict\", \"shape\": [1, 4], \"datatype\": \"FP32\", \"data\": [[1, 2, 3, 4]]}]}'`\n",
    "if [ $ret -ne 200 ]; then\n",
    "    echo \"Failed with code ${ret}\"\n",
    "    exit\n",
    "fi\n",
    "\n",
    "done\n",
    "echo \"All succeeded\""
   ]
  },
  {
   "cell_type": "markdown",
   "id": "552e62d9",
   "metadata": {},
   "source": [
    "Doing inference for all models succeeds as swapping in and out models is handled automatically"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "4b6359c6",
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "%%bash\n",
    "for i in {1..10}; \n",
    "do \n",
    "\n",
    "for j in {1..11};\n",
    "do\n",
    "curl -s -o /dev/null http://\"$INFER_ENDPOINT\"/v2/models/iris$j/infer -H \"Content-Type: application/json\"  \\\n",
    "        -d '{\"inputs\": [{\"name\": \"predict\", \"shape\": [1, 4], \"datatype\": \"FP32\", \"data\": [[1, 2, 3, 4]]}]}' &\n",
    "done\n",
    "\n",
    "done\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "10b53afb",
   "metadata": {},
   "source": [
    "Unload models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "entire-black",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "\n",
    "for i in {1..11};\n",
    "do\n",
    "\n",
    "grpcurl -d '{\"model\": {\"name\" : \"iris'\"$i\"'\"}}' \\\n",
    "         -plaintext \\\n",
    "         -import-path ../apis/ \\\n",
    "         -proto ../apis/mlops/scheduler/scheduler.proto \"$SCHEDULER_ENDPOINT\" seldon.mlops.scheduler.Scheduler/UnloadModel\n",
    "\n",
    "\n",
    "done"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "417559e0",
   "metadata": {},
   "source": [
    "## `tfsimple` model on `triton`"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1302a2c5",
   "metadata": {},
   "source": [
    "With `tfsimple` on `triton` we will reduce the memory slot required to 100KB, which will allow us to load at least 100 models on the server in memory. The remaining models (10) will have to be evicted."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "suburban-victim",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "loading model tfsimple1\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple2\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple3\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple4\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple5\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple6\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple7\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple8\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple9\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple10\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple11\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple12\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple13\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple14\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple15\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple16\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple17\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple18\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple19\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple20\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple21\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple22\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple23\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple24\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple25\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple26\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple27\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple28\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple29\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple30\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple31\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple32\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple33\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple34\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple35\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple36\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple37\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple38\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple39\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple40\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple41\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple42\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple43\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple44\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple45\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple46\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple47\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple48\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple49\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple50\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple51\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple52\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple53\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple54\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple55\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple56\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple57\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple58\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple59\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple60\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple61\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple62\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple63\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple64\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple65\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple66\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple67\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple68\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple69\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple70\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple71\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple72\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple73\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple74\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple75\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple76\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple77\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple78\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple79\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple80\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple81\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple82\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple83\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple84\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple85\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple86\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple87\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple88\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple89\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple90\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple91\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple92\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple93\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple94\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple95\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple96\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple97\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple98\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple99\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple100\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple101\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple102\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple103\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple104\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple105\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple106\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple107\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple108\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple109\n",
      "{\n",
      "  \n",
      "}\n",
      "loading model tfsimple110\n",
      "{\n",
      "  \n",
      "}\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "for i in {1..110}; \n",
    "do\n",
    "\n",
    "echo \"loading model tfsimple$i\"\n",
    "\n",
    "data='{ \n",
    "        \"model\":{ \n",
    "            \"meta\": {\"name\":\"tfsimple'\"$i\"'\"}, \n",
    "            \"modelSpec\" : { \n",
    "                \"uri\":\"gs://seldon-models/triton/simple\", \n",
    "                \"requirements\":[\"tensorflow\"],  \n",
    "                \"memoryBytes\":100000}, \n",
    "            \"deploymentSpec\": {\"replicas\":1}\n",
    "            }\n",
    "      }'\n",
    "\n",
    "grpcurl -d \"$data\" \\\n",
    "-plaintext \\\n",
    "-import-path ../apis \\\n",
    "-proto ../apis/mlops/scheduler/scheduler.proto \"$SCHEDULER_ENDPOINT\" seldon.mlops.scheduler.Scheduler/LoadModel\n",
    "\n",
    "sleep 0.05\n",
    "done"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "3ec2e8ed",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "All succeeded\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "for i in {1..110}; \n",
    "do\n",
    "\n",
    "url=http://${INFER_ENDPOINT}/v2/models/tfsimple${i}/infer \n",
    "ret=`curl -s -o /dev/null -w \"%{http_code}\" curl -s -o /dev/null -w \"%{http_code}\" \"${url}\" -H \"Content-Type: application/json\" \\\n",
    "        -d '{\"inputs\":[{\"name\":\"INPUT0\",\"data\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],\"datatype\":\"INT32\",\"shape\":[1,16]},{\"name\":\"INPUT1\",\"data\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],\"datatype\":\"INT32\",\"shape\":[1,16]}]}'`\n",
    "if [ $ret -ne 200 ]; then\n",
    "    echo \"Failed with code ${ret}\"\n",
    "    exit\n",
    "fi\n",
    "done\n",
    "echo \"All succeeded\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3682fea5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "  \"models\": [\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple89_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple34_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple59_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple76_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple45_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple60_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple8_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple19_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple31_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple85_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple107_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple27_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple51_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple91_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple2_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple24_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple53_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple98_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple17_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple35_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple38_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple12_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple83_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple99_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple20_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple58_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple101_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple37_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple63_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple87_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple40_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple72_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple94_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple4_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple80_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple95_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple26_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple48_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple55_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple75_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple100_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple41_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple43_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple56_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple73_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple74_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple21_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple42_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple82_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple86_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple97_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple106_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple108_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple10_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple15_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple67_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple105_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple7_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple22_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple61_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple25_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple54_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple64_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple6_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple90_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple96_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple16_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple62_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple71_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple28_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple103_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple5_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple93_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple14_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple69_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple84_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple36_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple104_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple70_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple110_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple9_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple57_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple65_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple109_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple30_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple66_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple68_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple39_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple44_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple88_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple13_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple23_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple29_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple50_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple79_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple3_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple18_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:29Z\",\n",
      "      \"name\": \"tfsimple102_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple92_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple49_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple77_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple78_1\"\n",
      "    },\n",
      "    {\n",
      "      \"lastAccessed\": \"0001-01-01T00:00:00Z\",\n",
      "      \"name\": \"tfsimple1_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple47_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:28Z\",\n",
      "      \"name\": \"tfsimple81_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple11_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple33_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple46_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:27Z\",\n",
      "      \"name\": \"tfsimple52_1\"\n",
      "    },\n",
      "    {\n",
      "      \"state\": \"InMemory\",\n",
      "      \"lastAccessed\": \"2023-01-20T18:48:26Z\",\n",
      "      \"name\": \"tfsimple32_1\"\n",
      "    }\n",
      "  ]\n",
      "}\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "grpcurl -d '{}' \\\n",
    "         -plaintext \\\n",
    "         -import-path ../apis/ \\\n",
    "         -proto ../apis/mlops/agent_debug/agent_debug.proto  ${TRITON_DEBUG} seldon.mlops.agent_debug.AgentDebugService/ReplicaStatus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "b73a8f61",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n",
      "{\n",
      "  \n",
      "}\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "\n",
    "for i in {1..110};\n",
    "do\n",
    "\n",
    "grpcurl -d '{\"model\": {\"name\" : \"tfsimple'\"$i\"'\"}}' \\\n",
    "         -plaintext \\\n",
    "         -import-path ../apis/ \\\n",
    "         -proto ../apis/mlops/scheduler/scheduler.proto \"$SCHEDULER_ENDPOINT\" seldon.mlops.scheduler.Scheduler/UnloadModel\n",
    "\n",
    "\n",
    "done"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8a35cb6c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.12 ('seldon-core-v2-python-3.8')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.12"
  },
  "vscode": {
   "interpreter": {
    "hash": "dc8b7b3d3b143757bd161269cf4ea949ead8c2ebc12155bae9e3cf57923f4a90"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
